package com.ruoyi.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.SysFile;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 附件Service接口
 * 
 * @author ruoyi
 * @date 2022-09-04
 */
public interface ISysFileService  extends IService<SysFile>
{

    /**
     * 文件下载
     *
     * @param filePath
     * @param delete
     * @param response
     * @return
     */
    void download(String filePath, String fileName, Boolean delete, HttpServletResponse response);

    /**
     * 按照文件地址获取文件
     *
     * @param filePath
     * @param delete
     * @return
     */
    byte[] getFile(String filePath, Boolean delete);

    /**
     * 按照文件地址获取文件
     *
     * @param filePath
     * @param delete
     * @return
     */
    byte[] returnFile(String filePath, Boolean delete);

    /**
     * 文件上传
     *
     * @param file
     * @return java.lang.String
     */
    SysFile upload(MultipartFile file);

    /**
     * 文件批量上传
     *
     * @param file
     * @return java.lang.String
     */
    List<SysFile> upload(MultipartFile[] file);

    /**
     * //TODO 描述
     *
     * @param file
     * @return com.megalink.system.api.domain.SysFile
     */
    SysFile uploadImg(MultipartFile file, int width, int height);

    /**
     * 删除文件
     *
     * @param fileId
     * @return void
     */
    void delete(Long fileId);

    /**
     * PDF下载
     *
     * @param fileId
     * @return void
     */
    void downloadPDF(Long fileId, String pdfFontPath, String markStr, HttpServletResponse response);

    /**
     * byte[] 文件上传
     *
     * @param bytes
     * @param fileExtension 文件类型(扩展名)
     * @return
     */
    SysFile upload(byte[] bytes, String oriFileName, String fileExtension);

}
